import { View } from '@tarojs/components';
import { Image } from '@taroify/core';
import { addUnits, formatTime, imgAddPrefix } from '@/utils';
import { PlayCircleOutlined } from '@taroify/icons';
import Taro from '@tarojs/taro';

export default ({ height = 200 }: { height?: number }) => {
  return (
    <View
      className="w-full"
      onClick={() => Taro.navigateTo({ url: '/pages/video/index?id=1' })}
    >
      <View className="relative">
        <Image
          className="w-full  rounded-t-xl"
          style={{ height }}
          src={imgAddPrefix('https://img.yzcdn.cn/vant/cat.jpeg')}
        />
        <View className=" absolute bg-black opacity-40 flex justify-between inset-x-0 bottom-0 py-1 px-3 text-white">
          <View className="flex gap-1 items-center">
            <PlayCircleOutlined />
            <View>{addUnits(3231233)}</View>
          </View>
          <View>{formatTime(232)}</View>
        </View>
      </View>
      <View>个性自我，随心自由</View>
    </View>
  );
};
